#ifndef HERBSELECTEDDIALOG_H
#define HERBSELECTEDDIALOG_H

#include <QDialog>
#include <QHash>
#include "Herb.h"
#include <QListWidgetItem>

namespace Ui {
class HerbSelectedDialog;
}

class HerbSelectedDialog : public QDialog
{
    Q_OBJECT

public:
    explicit HerbSelectedDialog(const QHash<QString,Herb>&herbs,
                                QWidget *parent=nullptr);
    ~HerbSelectedDialog();

    QString selectedHerb() const ;

private slots:
    void handleItemClicked(QListWidgetItem * item);


private:
    void populateHerbsList();

    Ui::HerbSelectedDialog *ui;
    QHash<QString,Herb>m_herbs;
    QString m_selectedHerb;
};

#endif // HERBSELECTEDDIALOG_H
//弹窗头文件
